<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>样式class对象绑定</title>
    <style>
        .activated {
            color: red;
        }
    </style>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <div @click="clickDivHandle" :class="{activated : isActivated}">
            Hello World ...
        </div>
    </div>
<script>
    new Vue({
        el : "#app" ,
        data : {
            isActivated : false
        },
        methods : {
            clickDivHandle : function(){
                this.isActivated = !this.isActivated
            }
        }
    })
</script>
</body>
</html>